package org.zsl.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zsl.dao.mybatis.UserMapper;
import org.zsl.model.ResponseMessage;
import org.zsl.model.User;

import java.util.List;

@Service
public class UserService3 {
    @Autowired
    private UserMapper userMapper;


    public List<User> getList(){

        return  userMapper.selectAll();
    }


    public ResponseMessage register(User user){

         ResponseMessage responseMessage = new ResponseMessage();

         Boolean flag= userMapper.insert(user)>1;
         responseMessage.setSuccess(flag);

         return  responseMessage;

    }
}
